<?php

class FP_Model_Paginator_Adapter implements Zend_Paginator_Adapter_Interface {

   protected $_criteria = null;
   protected $_gateway = null;
   protected $_count = null;
   protected $_orderby = null;

   public function __construct($pCriteria, FP_Model_Gateway_Interface $pGateway, $pOrderBy=null){
      $this->_criteria = $pCriteria;
      $this->_gateway = $pGateway;
      $this->_orderby = $pOrderBy;
   }

   public function getItems($pOffset, $pLimit){
      return $this->_gateway->fetch($this->_criteria, $pOffset, $pLimit, $this->_orderby);
   }

   public function count(){
      return $this->_gateway->count($this->_criteria);
   }
}

?>